
<template tag="以下文档内容为hycli自动生成">
  <div>
  <el-dialog
    v-model="conf.visible"
    :title="title"
    draggable
    align-center="true"
    width="68%"
    :close-on-click-modal="false"

  >
    <el-tabs v-model="conf.selected">
      <el-tab-pane label="详情" name="aaatv">
<el-row :gutter="24" style="font-size: 0.7rem;">
  <el-col :span="4" class="text-right" style="min-height:26px">角色编号:</el-col>
  <el-col :span="8" v-text="view.role_id||'-'" style="min-height:26px" ></el-col>
  <el-col :span="4" class="text-right" style="min-height:26px">角色名称:</el-col>
  <el-col :span="8" v-html="view.name||'-'" style="min-height:26px" ></el-col>
  <el-col :span="4" class="text-right" style="min-height:26px">数据权限:</el-col>
  <el-col :span="8" v-text="view.data_authority_label" style="min-height:26px" ></el-col>
  <el-col :span="4" class="text-right" style="min-height:26px">状态:</el-col>
  <el-col :span="8" v-text="view.status_label" style="min-height:26px" ></el-col>
  <el-col :span="4" class="text-right" style="min-height:26px">创建时间:</el-col>
  <el-col :span="8" v-text="view.create_time||'-'" style="min-height:26px" ></el-col>
</el-row>
      </el-tab-pane>
        <el-tab-pane label="页面权限" name="aaatu"  @tab-click="show_view_aaatu">
          <el-row>
            <el-col :span="24" class="text-right">
          <el-button type="success" icon="Plus"
           round  @click="show_cmpnt_aabef">添加</el-button>
        </el-col>
          </el-row>
<div class="list">
    <el-table :data="dataList_aaatu"
    
    v-loading="conf.loading" stripe 
        style="width: 100%;height:300px" 
         empty-text="无数据">le
<el-table-column width="24px" type="expand">
    <template #default="view">
        <el-row :gutter="24">
            <el-col :span="5" class="text-right" style="min-height:26px">编号:</el-col>
            <el-col :span="7" v-text="view.row.le_id" style="min-height:26px" ></el-col>
            <el-col :span="5" class="text-right" style="min-height:26px">系统:</el-col>
            <el-col :span="7" v-text="view.row.sys_id_label" style="min-height:26px"
              ></el-col>
            <el-col :span="5" class="text-right" style="min-height:26px">角色:</el-col>
            <el-col :span="7" v-text="view.row.role_id_label" style="min-height:26px"
              ></el-col>
            <el-col :span="5" class="text-right" style="min-height:26px">菜单:</el-col>
            <el-col :span="7" v-text="view.row.menu_id_label" style="min-height:26px"
              ></el-col>
            <el-col :span="5" class="text-right" style="min-height:26px">创建时间:</el-col>
            <el-col :span="7" v-text="view.row.le_create_time" style="min-height:26px" ></el-col>
        </el-row>
    </template>
</el-table-column>
        
        	<!--id text -->
        <el-table-column  show-overflow-tooltip    align="center" label="编号" >
            <template #default="scope">
                  <span>{{ scope.row.id||'-' }}</span>
              </template>
        </el-table-column>
        	<!--sys_id select -->
        <el-table-column     prop="sys_id" align="center" label="系统">
            <template #default="scope">
                <span 
                    v-text="scope.row.sys_id_label"></span>
            </template>
        </el-table-column>
        	<!--role_id select -->
        <el-table-column     prop="role_id" align="center" label="角色">
            <template #default="scope">
                <span 
                    v-text="scope.row.role_id_label"></span>
            </template>
        </el-table-column>
        	<!--menu_id select -->
        <el-table-column     prop="menu_id" align="center" label="菜单">
            <template #default="scope">
                <span 
                    v-text="scope.row.menu_id_label"></span>
            </template>
        </el-table-column>
        	<!--create_time date -->
        <el-table-column  show-overflow-tooltip    align="center" label="创建时间" >
            <template #default="scope">
                  <span>{{ scope.row.create_time||'-' }}</span>
              </template>
        </el-table-column>

<el-table-column fixed="right" align="center" label="操作" width="56">
    <template #default="scope">
        <div class="opts">
            <el-button   type="text" @click="show_cmpnt_aabeg(scope.row)" >编辑 </el-button>
        </div>
    </template>
</el-table-column>
    </el-table>
</div>
         </el-tab-pane>
    </el-tabs>
    <template #footer>
      <span style="height: 60px"> </span>
    </template>
    <aabef ref="cmpnt_aabef" @onsaved="show(form)"></aabef>
    <aabeg ref="cmpnt_aabeg" @onsaved="show(form)"></aabeg>
  </el-dialog>
</div>
</template>
<script>
import gantt from "@/views/cmpnts/gantt.vue"
import aabef from "@/views/sso/role/role_menu.add"
import aabeg from "@/views/sso/role/role_menu.edit"
export default {
   components: {
    gantt,
    aabef,
    aabeg,
  },
  data() {
    return {
        conf:{
        visible:false,
        
        selected:"aaatu",
      },
      title:"角色信息详情",
      form:{},
        form_aaatu: {
            pi: 1,
            ps: 15,
            disabled:false,
            single_date_range_name:"",
            single_date_range_value:[],
            single_text_name:"",
            single_text_value:"",
            sys_id:"",
            role_id:"",
            },
            sys_idList:[],
            role_idList:[],
            menu_idList:[],
            dataList_aaatu:[],
            multiQueryDateRange:[],
            multiQueryText:[],
            total_aaatu:0,
            note_dataList:[],
      view: {
        role_id:"",
        name:"",
        data_authority:"",
        status:"",
        create_time:"",
        },
      }
  },
  methods: {
  show_cmpnt_aabef(fm = {}){
    let form = Object.assign({},this.form)
    form = Object.assign(form,fm)
    form.status = "0"
    this.$refs.cmpnt_aabef.show(form)
  },
  show_cmpnt_aabeg(fm = {}){
    let form = Object.assign({},this.form)
    form = Object.assign(form,fm)
    this.$refs.cmpnt_aabeg.show(form)
  },
  show_cmpnt_aaatt(fm = {}){
    let form = Object.assign({},this.form)
    form = Object.assign(form,fm)
    form.status = "0"
    this.$refs.cmpnt_aaatt.show(form)
  },
  show_cmpnt_aaats(fm = {}){
    let form = Object.assign({},this.form)
    form = Object.assign(form,fm)
    this.$refs.cmpnt_aaats.show(form)
  },
  show_cmpnt_aaatr(fm = {}){
    let form = Object.assign({},this.form)
    form = Object.assign(form,fm)
    this.$refs.cmpnt_aaatr.show(form)
  },
 show(form) {
    this.conf.visible = true
    this.form = form
    //页面权限查询
    let nform_aaatu = {}
    this.queryData_aaatu(form,nform_aaatu)
   let that = this;
   this.$theia.http
      .get("/sso/role/info",form)
      .then((res) => {
        let item = Object.assign({}, res)
        item.data_authority_label = that.$theia.enum.getName("my_business_line",item.data_authority)
        item.status_label = that.$theia.enum.getName("status",item.status)  
        item.name = (item.name||"")  
        item.data_authority = (item.data_authority||"")
        item.create_time = that.$theia.str.dateFormat(item.create_time,'MM/dd')
        that.view = item
      })
      .catch((res) => {
        let code = res.response.status;
        let msg = `角色信息查询失败(${code})`;
        that.$notify.error({ title: "失败", message: msg, duration: 5000 });
      });
  },

queryData_aaatu(mform = {},nform={}){
    //构建查询参数
    let queryForm = Object.assign({},this.form_aaatu)
    queryForm = Object.assign(queryForm,nform||{})
    
    //处理多个日期选择
    queryForm[this.form_aaatu.single_date_range_name] = this.form_aaatu.single_date_range_value
    queryForm[this.form_aaatu.single_text_name] = this.form_aaatu.single_text_value
   
    //处理日期范围选择

    queryForm[this.form_aaatu.single_date_range_name] = null
    queryForm.single_date_range_value = null
    queryForm.single_date_range_name = null

    queryForm.single_text_value = null
    queryForm.single_text_name = null
 
    //处理关联表role_menu role_info 
    queryForm.role_id = mform.role_id
   
    //发送查询请求
    let that = this
    that.conf.loading = true
    queryForm.ps = 100
    //构建统计查询
  //数据查询
  this.$theia.http.get("/sso/role/menu/query",queryForm).then(res=>{
      if((res.items||[]).length < (queryForm.ps||10)){
        that.form_aaatu.disabled = true
      }
      that.conf.loading = false
      that.dataList_aaatu = res.items||[]
      that.total_aaatu = res.count
      that.resetItemData_aaatu(that,that.dataList_aaatu)
    });
  },

  resetItemData_aaatu(that,lst){
    lst.forEach(item => {
      item.__raw = Object.assign({}, item)
    item.sys_id_label = that.$theia.enum.getName("system_info",item.sys_id)
    item.role_id_label = that.$theia.enum.getName("role_info",item.role_id)
    item.menu_id_label = that.$theia.enum.getName("system_menu",item.menu_id)
    item.id_progress = item.id
    item.sys_id_progress = item.sys_id
    item.role_id_progress = item.role_id
    item.menu_id_progress = item.menu_id
    item.create_time_progress = item.create_time
    item.le_id = item.id
    item.le_sys_id = item.sys_id
    item.le_role_id = item.role_id
    item.le_menu_id = item.menu_id
    item.le_create_time = that.$theia.str.dateFormat(item.create_time,'MM/dd')
    item.create_time = that.$theia.str.dateFormat(item.create_time,'MM/dd')
    if(item.children){
      that.resetItemData_aaatu(that,item.children)
    }
  });
  },
    loadEnums_aaatu(){
        //系统
        this.sys_idList = this.$theia.enum.get("system_info","","" ,false,"")
        //角色
        this.role_idList = this.$theia.enum.get("role_info","","" ,false,"")
        //系统
        this.sys_idList = this.$theia.enum.get("system_info","","" ,false,"")
        //角色
        this.role_idList = this.$theia.enum.get("role_info","","" ,false,"")
        //菜单
        this.menu_idList = this.$theia.enum.get("system_menu","","" ,false,"")
    },

  },
};
</script>
<style scoped>
/deep/.el-step__title{
    font-size: 0.8rem;
}
.steps{
  margin-top:8px;
  margin-bottom:  16px;
}
</style>